const {
    Role
} = require('../../../model/Role');

module.exports = async (req, res) => {
    const filter = {
        rid: req.params['rid']
    };
    const update = req.fields;
    Role.findOneAndUpdate(filter, update, {
            new: true
        })
        .then(data => res.sendResult(data, 200, '修改成功'))
        .catch(err => res.sendResult(err, 400, '修改失败'));
}